package com.shanzmoo.core.domain;

import com.alibaba.fastjson.JSON;
import com.shanzmoo.db.sys.entity.UserEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * 用户更新对象
 * @author Gzhao
 * @date 2020/11/16
 */
@Data
@ApiModel(value = "用户更新对象")
public class UserUpdateDto extends UserSaveDto{

    @NotNull(message = "用户id不允许为空")
    private Integer userId;

    public static UserEntity converted(UserUpdateDto saveDto) {
        return JSON.parseObject(JSON.toJSONString(saveDto), UserEntity.class);
    }
}
